package ssm.pojo;

import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;

//订单
public class Orders {
    private String oid;//订单编号
    private LocalDateTime ordertime;//订单时间
    private Double total;//总计金额

    private int state;//订单状态 0 未支付  1 已支付
    private String address;//订单地址

    private String name;//下单的用户名
    private String telephone;//下订单的联系方式
    private User user;//属于哪个用户

    //订单项
    private List<Orderitem>  items = new LinkedList<>();

    public Orders() {
    }

    public Orders(String oid, LocalDateTime ordertime, Double total, int state, String address, String name, String telephone, User user, List<Orderitem> items) {
        this.oid = oid;
        this.ordertime = ordertime;
        this.total = total;
        this.state = state;
        this.address = address;
        this.name = name;
        this.telephone = telephone;
        this.user = user;
        this.items = items;
    }

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public LocalDateTime getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(LocalDateTime ordertime) {
        this.ordertime = ordertime;
    }

    public Double getTotal() {
        return total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<Orderitem> getItems() {
        return items;
    }

    public void setItems(List<Orderitem> items) {
        this.items = items;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "oid='" + oid + '\'' +
                ", ordertime=" + ordertime +
                ", total=" + total +
                ", state=" + state +
                ", address='" + address + '\'' +
                ", name='" + name + '\'' +
                ", telephone='" + telephone + '\'' +
                ", items=" + items +
                '}';
    }
}
